From 17cc43379f1300307519b31cf8188843fdfaec7f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 7 Oct 2015 10:37:56 -0700 Subject: [PATCH] Update TOML dependency Closes #2031 Closes #2033 --- Cargo.lock | 4 ++-- tests/test_bad_config.rs | 28 +++++++++++++++++++++++++++- tests/test_cargo_compile.rs | 13 +++++++++++++ 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3f94ce068..e3652630a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,7 +27,7 @@ dependencies = [ "tempdir 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -391,7 +391,7 @@ dependencies = [ [[package]] name = "toml" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/tests/test_bad_config.rs b/tests/test_bad_config.rs index 069783906..0854b4e4b 100644 --- a/tests/test_bad_config.rs +++ b/tests/test_bad_config.rs @@ -190,7 +190,7 @@ Caused by: Caused by: could not parse input as TOML -[..]config:2:1 expected `=`, but found eof +[..]config:1:2 expected `=`, but found eof ")); }); @@ -258,3 +258,29 @@ test!(bad_crate_type { warning: crate-type \"bad_type\" was not one of lib|rlib|dylib|staticlib ")); }); + +test!(malformed_override { + let foo = project("foo") + .file("Cargo.toml", r#" + [package] + name = "foo" + version = "0.0.0" + authors = [] + + [target.x86_64-apple-darwin.freetype] + native = { + foo: "bar" + } + "#) + .file("src/lib.rs", ""); + + assert_that(foo.cargo_process("build"), + execs().with_status(101).with_stderr("\ +failed to parse manifest at `[..]` + +Caused by: + could not parse input as TOML +Cargo.toml:[..] + +")); +}); diff --git a/tests/test_cargo_compile.rs b/tests/test_cargo_compile.rs index ebef666bf..646b50651 100644 --- a/tests/test_cargo_compile.rs +++ b/tests/test_cargo_compile.rs @@ -2039,3 +2039,16 @@ test!(invalid_spec { "could not find package matching spec `notAValidDep`".to_string())); }); + +test!(manifest_with_bom_is_ok { + let p = project("foo") + .file("Cargo.toml", "\u{FEFF} + [package] + name = \"foo\" + version = \"0.0.1\" + authors = [] + ") + .file("src/lib.rs", ""); + assert_that(p.cargo_process("build").arg("-v"), + execs().with_status(0)); +}); -- 2.30.2